<template>
  <scroll-view enable-flex scroll-y class="category-panel">
    <navigator
      v-for="(item, index) in props.list"
      :key="item.id"
      class="item-box"
      :url="`/pages/category/category?type=${index}`"
      open-type="reLaunch"
      hover-class="none"
    >
      <view class="image-box">
        <image :src="item.icon" class="image"></image>
      </view>
      <text class="name">{{ item.name }}</text>
    </navigator>
  </scroll-view>
</template>

<script lang="ts" setup>
import type { TCategoryItem } from '@/types/home'
import { onLoad } from '@dcloudio/uni-app'

const props = defineProps<{
  list: TCategoryItem[]
}>()

onLoad(() => {
  console.log('123')
  console.log(props, 'props')
})
</script>

<style lang="scss" scoped>
@import '../styles/CategoryPanel';
</style>
